package com.lagou.db;


import lombok.*;

import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

@Table(name = "product")
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class Product implements Serializable {

  @Id
  private Long id;

  private String name;
  private Double price;
  private String flag;
  private String goodsDesc;
  private String images;
  private Integer goodsStock;
  private String goodsType;


  public static com.lagou.pojo.Product converter(Product product){
    com.lagou.pojo.Product p = new com.lagou.pojo.Product();

    p.setId(product.getId());
    p.setName(product.getName());
    p.setPrice(product.getPrice());
    p.setImages(product.getImages());
    p.setFlag(product.getFlag());
    p.setGoods_desc(product.getGoodsDesc());
    p.setGoods_stock(product.getGoodsStock());
    p.setGoods_type(product.getGoodsType());

    return p;
  }

}
